import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

// 登出
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

export function totalList(data) {
  return request({
    url: '/total/list',
    method: 'post',
    data
  })
}

export function contactList(data) {
  return request({
    url: '/contact/list',
    method: 'post',
    data
  })
}

export function userInfo(data) {
  return request({
    url: '/user/info',
    method: 'post',
    data
  })
}

export function userCard(data) {
  return request({
    url: '/user/card',
    method: 'post',
    data
  })
}

export function commonConstants() {
  return request({
    url: '/common/constants',
    method: 'get'
  })
}

export function verifyExamineList(data) {
  return request({
    url: '/verify/examine/list',
    method: 'post',
    data
  })
}

export function verifyVisitList(data) {
  return request({
    url: '/verify/visit/list',
    method: 'post',
    data
  })
}

export function verifyVisit(data) {
  return request({
    url: '/verify/visit',
    method: 'post',
    data
  })
}

export function verifyBack(data) {
  return request({
    url: '/verify/back',
    method: 'post',
    data
  })
}

export function verifyPass(data) {
  return request({
    url: '/verify/pass',
    method: 'post',
    data
  })
}

export function verifyHistory(data) {
  return request({
    url: '/verify/history',
    method: 'post',
    data
  })
}

export function verifyColumn(data) {
  return request({
    url: '/verify/column',
    method: 'post',
    data
  })
}

export function verifyColumnHistory(data) {
  return request({
    url: '/verify/column/history',
    method: 'post',
    data
  })
}

export function verifyColumnPass(data) {
  return request({
    url: '/verify/column/pass',
    method: 'post',
    data
  })
}












// export function getList() {
//   return request({
//     url: '/users',
//     method: 'get'
//   })
// }
export function getList() {
  return request({
    url: '/users/getEnableUser',
    method: 'get'
    // params:{
    //   status:1
    // }
  })
}
export function getInfo() {
  return request({
    url: '/login/user_info',
    method: 'get'
  })
}



export function getUserPage(params) {
  return request({
    url: '/users/page',
    method: 'get',
    params
  })
}

export function addUser(data) {
  return request({
    url: '/users',
    method: 'post',
    data
  })
}

export function updateUser(id, data) {
  return request({
    url: '/users/' + id,
    method: 'put',
    data
  })
}

export function deleteUser(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}
export function updatapwd(data) {
  return request({
    url: `/users/change?newPwd=${data.newPwd}&pwd=${data.pwd}`,
    method: 'put'
  })
}
export function resetPwd(id) {
  return request({
    url: `/users/reset?id=` + id,
    method: 'put'

  })
}
export function sendma(params) {
  return request({
    url: `/project/send/msg`,
    method: 'get',
    params: params

  })
}
export function verification(data) {
  return request({
    url: '/login/Verification',
    method: 'get',
    responseType: 'blob'
  })
}
export function change1(data) {
  return request({
    url: '/users/change1',
    method: 'put',
    data
  })
}

export function getorgByUsername(params) {
  return request({
    url: `/org/getorgByUsername`,
    method: 'get',
    params: params
  })
}

export const companyPageList = (params) => {
  return request({
    url: `/company/pageList`,
    method: 'get',
    params
  })
}



